/**
 * 
 */
package test;

/**
 * @author bliu
 *
 */
public class ASCConvert {

	 public static String stringToAscii(String value)
	 {
	  StringBuffer sbu = new StringBuffer();
	  char[] chars = value.toCharArray();
	  for (int i = 0; i < chars.length; i++) {
	   if(i != chars.length - 1)
	   {
	    sbu.append((int)chars[i]).append("\\");
	   }
	   else {
	    sbu.append((int)chars[i]);
	   }
	  }
	  return sbu.toString();
	 }


	public static String asciiToString(String value)  
	{  
	    StringBuffer sbu = new StringBuffer();  
	    String[] chars = value.split("\\\\");  
	    for (int i = 0; i < chars.length; i++) {  
	        sbu.append((char) Integer.parseInt(chars[i]));  
	    }  
	    return sbu.toString();  
	} 



	 public static void main(String[] args) {
	  /*String str = "彭玉军";
	  String asciiResult = stringToAscii(str);
	  System.out.println(asciiResult);
	  String stringResult = asciiToString("\\u9289\\u6129\\u5136\\u9289");
	  System.out.println(stringResult);
	  */
	  
	  
	  System.out.println("\\u9289\\u6129\\u5136\\u9289\u30E3\u5157\u9288\u70BD\u512A\u9289\u7B3A\u5063:\u9287\u65C0\u655E\u93C2\u56E5\u5111\u9289\u7B3A\u506A\u5A23\u8BB3\u7CAF_\u9288\u5E7F\u512A\u9289\u7B3A\u506A\u9289\uFFFD(.*)");
	 }
}
